﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="askcontent.aspx.cs" Inherits="HFWebApp.FAQs.askcontent" %>
<%@ Register src="../Control/top.ascx" tagname="top" tagprefix="uc1" %>
<%@ Register src="../Control/end.ascx" tagname="end" tagprefix="uc2" %>
<%@ Register src="../Control/public_tuijianLawyer.ascx" tagname="public_tuijianLawyer" tagprefix="uc3" %>
<%@ Register src="../Control/public_ProvinceLeg.ascx" tagname="public_ProvinceLeg" tagprefix="uc4" %>
<%@ Register src="../Control/public_ProvinceLawyer.ascx" tagname="public_ProvinceLawyer" tagprefix="uc5" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title><%=model.Title%>_红法网</title>
<link href="<%=this.getDemain %>/Style/Style.css" rel="stylesheet" type="text/css" />
<link href="<%=this.getDemain %>/CSS.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=this.getDemain %>/Scripts/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=this.getDemain %>/javascript/SwitchTags.js"></script>
<script type="text/javascript" src="<%=this.getDemain %>/Scripts/WebFunction.js"></script>
<script type="text/javascript">
    function answers() {
        var content = $("#content");
        if (content.val() == "") {
            alert('回复内容不能为空');
            content.focus();
            return false;
        }
        var secretcontent = $("#secretcontent");
        var askid = '<%=model.ID %>';
        $.getJSON(
            "/AjaxSource/AddAnswer.ashx",
            {
                content: content.val(),
                secretcontent: secretcontent.val(),
                askid: askid,
                rand: Math.floor(Math.random() * 10000).toString()
            },
            function (jsonData) {
                alert(jsonData.Message);
                if (jsonData.isTrue) {
                    content.val("");
                    secretcontent.val("");
                    window.location.reload();

                }
            }
        );
        return false;
    }
    //检测用户是否登录
    function setBestAnswet(AnswerID ,AskID) {
        $.getJSON(
            "/AjaxSource/SetBestAnswer.ashx",
            {
                answerid: AnswerID,
                askid: AskID,
                rand: Math.floor(Math.random() * 10000).toString()
            },
            function (jsonData) {
                alert(jsonData.Message);
                if (jsonData.isTrue) {
                    window.location.reload();
                }
            }
        );
    }
</script>
    <style type="text/css">
        .content
        {
            height: 197px;
            width: 552px;
        }
        .secretcontent
        {
            width: 553px;
        }
        .style1
        {
            height: 29px;
        }
    </style>
</head>

<body>
<uc1:top ID="top1" MenuClassID="2" focusLink2="focusLink" runat="server" />
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="730" valign="top"><table width="720" border="0" cellpadding="0" cellspacing="0" class="bk_h" style="margin-bottom:12px">
        <tr>
          <td height="300" valign="top" class="bt_bj_26"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="37" class="bt_14_x" style="padding-left:10px"><%=this.GetAskStatus(model.StatusID.ToString())%></td>
              </tr>
          </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bk_x_x">
              <tr>
                <td height="40" align="center" class="bt_20_yh"><%=model.Title%></td>
              </tr>
          </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bk_x_x">
              <tr>
                <td height="32" align="center"><%=model.ProvinceName %>－<%=model.CityName %> <%=model.timeString %>  <span class="h_12">悬赏 <%=model.Points %></span> 发布者:<%=model.UserName%> 回答:(<%=model.AnswerCount %>) <%#GetAskStatus(Eval("StatusID").ToString())%></td>
              </tr>
          </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bk_x_x" style="padding:8px;">
              <tr>
                <td class="xw_30" style="height:120px;"><%=model.Content %></td>
              </tr>
          </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="40" align="center" bgcolor="#e6f2ff" class="xw_30">您也有法律问题？ 您可以 <span class="h_14_x">发布咨询</span>，我们的律师随时在线为您服务</td>
              </tr>
          </table></td>
        </tr>
    </table>
    <table width="720" border="0" cellpadding="0" cellspacing="0" class="bk_h">
        <form id="reForm" onsubmit="return answers();">
        <tr>
          <td valign="top" class="bt_bj_26">
          <%if (model.StatusID == 0)
            { %>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="37" class="bt_14_x" style="padding-left:10px">我来回答</td>
            </tr>
          </table>
          <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bk_sx">
                      <tr>
                        <td valign="top" bgcolor="#f2fbff"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="40" class="" style=" text-align:center; padding-top:10px;"><textarea id="content" name="content" class="content"></textarea></td>
                          </tr>
                        </table>
                          <table width="100%" border="0" cellspacing="0" cellpadding="0" 
                                style="padding-left:0px; height: 79px;">
                            <tr>
                              <td class="style1" style=" text-align:center;" width="80">私密回答</td>
                              <td class="style1"><input id="secretcontent" name="secretcontent" class="secretcontent" type="text" /></td>
                            </tr>
                            <tr>
                              <td height="24" class="" width="80">&nbsp;</td>
                              <td height="24"><input id="Button1" type="submit" value="提交答案" /></td>
                            </tr>
                        </table></td>
                      </tr>
                  </table>
                  <%} %>
          </td>
        </tr>
        </form>
    </table>
    <br />
      <table width="720" border="0" cellpadding="0" cellspacing="0" class="bk_h">
        <tr>
          <td valign="top" class="bt_bj_26"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="37" class="bt_14_x" style="padding-left:10px">全部答案</td>
            </tr>
          </table>
              <%foreach (hf.Model.Answer an in list)
                { %>
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="bk_sx">
                      <tr>
                        <td width="120" align="center" valign="top" class="bk_x_y" style="padding-bottom:8px">
                        <%if (an.lawyer != null)
                          { %>
                        <table width="84" border="0" cellpadding="0" cellspacing="0" class="bk_h" style="margin-top:12px">
                          <tr>
                            <td height="88" align="center"><img src="<%=this.getDemain + this.getUpFileFolder + an.lawyer.HeadPic %>" width="74" height="80" /></td>
                          </tr>
                        </table>
                          <table width="100" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td align="center" class="h_24">[<%=an.lawyer.ProvinceName %>-<%=an.lawyer.CityName %>]<br />
                                <a href="<%=this.getDemain %>/lawyeruser/lawyer.aspx?id=<%=an.lawyer.ID %>" class="l_27"><%=an.lawyer.RealName%>律师</a> <br />
                                电话：<%=an.lawyer.Phone %><br />
                                <span class="h_12"><%=an.lawyer.Point %>积分</span></td>
                            </tr>
                          </table>
                        <input type="button" onclick="location='<%=this.getDemain %>/lawyeruser/lawyer.aspx?id=<%=an.lawyer.ID %>'" name="button" id="button" value="立即咨询" /><%} %></td>
                        <td valign="top" bgcolor="#f2fbff"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="40" class="bk_x_x" style="padding-left:8px">回复时间： <%=an.Addtime%></td>
                          </tr>
                          <tr>
                            <td height="40" style="padding-left:8px"><%=an.Content %></td>
                          </tr>
                        </table>
                          <table width="100%" border="0" cellspacing="0" cellpadding="0" style="padding-left:24px">
                            <tr>
                              <td height="24" class="bk_x_l"></td>
                            </tr>
                            <tr>
                              <td height="24">
                              <%if (user!=null)
                                {
                                    if (this.getLoginAccount().ID == model.UserID && model.StatusID == 0)
                                    {
                                    %>
                              <a href="javascript:setBestAnswet('<%=an.ID %>','<%=an.AskID %>');" class="message">设置成最佳答案</a>
                              <%}
                                } %>&nbsp;&nbsp;&nbsp;<span class="h_12"><%=an.isBest.ToString() == "1"?"最佳答案":""%></span></td>
                            </tr>
                        </table></td>
                      </tr>
                  </table><%} %>
          </td>
        </tr>
    </table>
    <div style="width:100%; text-align:center; height:25px; line-height:25px;"><div class="manu"><%=PageStr %></div>
    </td>
    <td valign="top"><table width="250" border="0" cellpadding="0" cellspacing="0" class="bt_bj_25">
      <tr>
        <td height="31" valign="bottom"><table width="111" border="0" cellspacing="0" cellpadding="0" style="margin-left:6px">
          <tr>
            <td height="26" align="center" background="<%=this.getDemain %>/images/pro_bj1.jpg" class="bt_h_14">推荐律师</td>
          </tr>
        </table></td>
      </tr>
    </table>
      <table width="250" border="0" cellpadding="0" cellspacing="0" class="bk_xzy">
        <tr>
          <td height="325" valign="top">
              <uc3:public_tuijianLawyer ID="public_tuijianLawyer1" runat="server" />
            </td>
        </tr>
      </table>
      <table width="250" border="0" cellpadding="0" cellspacing="0" class="bk_h" style="margin-top:14px">
      <tr>
        <td height="280" valign="top"><table width="250" border="0" cellspacing="0" cellpadding="0" >
          <tr>
            <td height="30" background="<%=this.getDemain %>/images/bt_bj_3.jpg"><table width="130" border="0" cellspacing="0" cellpadding="0" style="margin-left:5px">
              <tr>
                <td height="28" align="center" background="<%=this.getDemain %>/images/bt_bj_23.jpg" class="bt_b_c" style="padding-top:2px">按地域查找法规</td>
              </tr>
            </table></td>
          </tr>
        </table><uc4:public_ProvinceLeg ID="public_ProvinceLeg1" runat="server" />
          </td>
      </tr>
    </table>
      <table width="250" border="0" cellpadding="0" cellspacing="0" class="bk_h" style="margin-top:12px">
        <tr>
          <td height="280" valign="top"><table width="250" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="30" background="<%=this.getDemain %>/images/bt_bj_3.jpg"><table width="130" border="0" cellspacing="0" cellpadding="0" style="margin-left:5px">
                <tr>
                  <td height="28" align="center" background="<%=this.getDemain %>/images/bt_bj_23.jpg" class="bt_b_c" style="padding-top:2px">按地域找律师</td>
                </tr>
              </table></td>
            </tr>
          </table><div style="width:240px; margin-left:auto; margin-right:auto; overflow:hidden; margin-top:6px;">
              <uc5:public_ProvinceLawyer ID="public_ProvinceLawyer1" runat="server" />
          </div></td>
        </tr>
    </table></td>
  </tr>
</table>
<uc2:end ID="end1" runat="server" />
</body>
</html>

